#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "installprogram.h"
#include <QLoggingCategory>
#include <QCloseEvent>
#include <QTime>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    // 允许 qDebug() 输出
    QLoggingCategory::defaultCategory()->setEnabled(QtDebugMsg, true);
    // 加载关于信息
    //QDateTime time;
    //time = time.currentDateTime();
    ui->information->setText("<p>" + QApplication::applicationName() + "</p>"\
                             "<p>本程序依照 GPLV3 协议开源" \
                             "<p>版本：" + QApplication::applicationVersion() + "</p>" + \
                             "<p>此项目链接：https://gitee.com/gfdgd-xi/wine-runner-virtual-machine</p>" \
                             "<p>https://github.com/gfdgd-xi/wine-runner-virtual-machine</p>" \
                             "<p>https://gitlink.org.cn/gfdgd-xi/wine-runner-virtual-machine</p>" \
                             "<p>Wine 运行器项目链接：</p>" \
                             "<p>https://gitee.com/gfdgd-xi/deep-wine-runner</p>" \
                             "<p>https://github.com/gfdgd-xi/deep-wine-runner</p>" \
                             "<p>https://gitlink.org.cn/gfdgd_xi/deep-wine-runner</p>" \
                             "<p>https://gitlab.com/gfdgd-xi/deep-wine-runner</p>" \
                             "<p>https://jihulab.com/gfdgd-xi/deep-wine-runner</p>" \
                             "<p>©2020~" + QDateTime::currentDateTime().toString("yyyy") + " gfdgd xi、为什么您不喜欢熊出没和阿布呢</p>");
}


MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_pushButton_clicked()
{
    // 关闭关于窗口
    close();
}
